import axios from '@/utils/request'
// 根据id查询公司信息
export const getCompanyById = (id) => {
  return axios({
    url: `/company/${id}`
  })
}
// 获取所有角色列表
export const getroleList = (params) => {
  return axios({
    url: '/sys/role',
    params
  })
}
// 根据id获取角色列表
export const roleListById = (id) => {
  return axios({
    url: `/sys/role/${id}`
  })
}
// 编辑角色
export const editroleById = (data) => {
  return axios({
    url: `/sys/role/${data.id}`,
    method: 'PUT',
    data
  })
}
// 删除角色
export const delroleById = (id) => {
  return axios({
    url: `/sys/role/${id}`,
    method: 'DELETE'
  })
}
// 新增角色
export const addrole = (data) => {
  return axios({
    url: '/sys/role',
    method: 'POST',
    data
  })
}
// 根据员工分配角色
export const RoleListById = (data) => {
  return axios({
    url: `/sys/user/assignRoles`,
    method: 'PUT',
    data
  })
}
// 给角色分配权限
export const permissionListById = (data) => {
  return axios({
    url: `/sys/role/assignPrem`,
    method: 'PUT',
    data
  })
}
